<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>注册信息</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
 
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" refresh="false"
  	action="registerInfoController.do?doAdd" tiptype="3" beforeSubmit="validateUser">
					<input id="id" name="id" type="hidden" value="${registerInfoPage.id }">
					<input id="createDate" name="createDate" type="hidden" value="${registerInfoPage.createDate }">
		<table style="" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							用户名:
						</label>
					</td>
					<td class="value">
					     	 <input id="userId" name="userId" type="text"  maxlength="10" style="width: 150px" class="inputxt"  datatype="*5-20">
							<span class="Validform_checktip">账号可由数字字母组合</span>
							<label class="Validform_label" style="display: none;">用户名</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							姓名:
						</label>
					</td>
					<td class="value">
					     	 <input id="name" name="name" type="text" style="width: 150px" class="inputxt"  datatype="*">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">姓名</label>
						</td>
				</tr>
				
				<tr>
					<td align="right">
						<label class="Validform_label">
							身份证号码:
						</label>
					</td>
					<td class="value">
					     	 <input id="idNumber" name="idNumber" type="text" style="width: 150px" class="inputxt"  datatype="*" maxlength="20">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">身份证号</label>
						</td>
				</tr>
				
				<tr>
					<td align="right">
						<label class="Validform_label">
							登录密码:
						</label>
					</td>
					<td class="value">
					     	 <input id="passwd" name="passwd" type="password" style="width: 150px" class="inputxt"  datatype="*"   maxlength="20">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">密码</label>
						</td>
				</tr>
				
				
				
				<tr>
					<td align="right">
						<label class="Validform_label">
							手机号:
						</label>
					</td>
					<td class="value">
					     	 <input id="cellphone" name="cellphone" type="text" style="width: 150px" maxlength="11" class="inputxt" datatype='m'>
							<span class="Validform_checktip">手机号长度为11位</span>
							<label class="Validform_label" style="display: none;">手机号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							邮箱:
						</label>
					</td>
					<td class="value">
					     	 <input id="email" name="email" type="text" style="width: 150px" class="inputxt" datatype='e'>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">邮箱</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							专业:
						</label>
					</td>
					<td class="value">
					     	 <input id="major" name="major" type="text" style="width: 150px" class="inputxt" >
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">专业</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							性别:
						</label>
					</td>
					<td class="value">
							  <t:dictSelect field="sex" type="radio"
									typeGroupCode="sex" defaultVal="${registerInfoPage.sex}" hasLabel="false"   title="性别"></t:dictSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">性别</label>
						</td>
				</tr>
			</table>
		</t:formvalid>
 </body>
 <script>
 	function validateUser(){
 		var userId = $("#userId").val();
 		var result = false;
 		$.ajax({
 			async:false,
 			type:'post',
 			url:'registerInfoController.do?existUsername',
 			data:{
 				name:userId
 			},
 			success:function(d){
  				d = $.parseJSON(d);
 				if(d.success){
 					tip('用户名已经存在！');
 					result = false;
 					window.top.operateOK = false;
 				}else{
 					result = true;
 					window.top.operateOK = true;
 				}
 			}
 		});
 		return result;
 	}
 </script>
  <script src = "webpage/com/mengtian_tech/device_mgr/register/registerInfo.js"></script>		
